﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ServiceModel;
using BiffenService.Model;

namespace BiffenService
{
    [ServiceContract]
    public interface IBiffenService
    {
        #region . GLOBAL .
        [OperationContract]
        bool IsItFriday();
        #endregion

        #region . PriceCategory .
        [OperationContract]
        PriceCategory GetPriceCategory(int id);
        
        [OperationContract]
        List<PriceCategory> GetAllPriceCategories();
        #endregion

        #region . Movie .
        [OperationContract]
        [FaultContract(typeof(BiffenServiceFault))]
        Movie GetMovie(int id);

        [OperationContract]
        [FaultContract(typeof(BiffenDataAccessFault))]
        List<Movie> GetAllMovies();

        [OperationContract]
        [FaultContract(typeof(BiffenServiceFault))]
        int AddMovie(Movie m);

        [OperationContract]
        [FaultContract(typeof(BiffenServiceFault))]
        int EditMovie(Movie m);

        [OperationContract]
        [FaultContract(typeof(BiffenServiceFault))]
        int DeleteMovie(int id);

        [OperationContract]
        [FaultContract(typeof(BiffenServiceFault))]
        List<Movie> GetCurrentMovies();

        [OperationContract]
        [FaultContract(typeof(IllegalParameterFault))]
        [FaultContract(typeof(EmptyParameterFault))]
        List<Movie> SearchMovies(ICollection<string> searchParams, string queryString);
        #endregion

        #region . Show .
        [OperationContract]
        List<Booking> GetBookingsForShow(Show show);

        [OperationContract]
        List<Show> GetShowsForMovie(int id);

        [OperationContract]
        List<Show> GetCurrentShowsSeven(DateTime date, int theaterId);

        [OperationContract]
        bool AddShow(Show show);

        [OperationContract]
        bool DeleteShow(Show show);

        #endregion

        #region . Booking .

        [OperationContract]
        List<Booking> FindBookingByPhone(int phone);

        [OperationContract]
        Booking FindBookingById(int bookingId);

        [OperationContract]
        int DeleteBookingById(int bookingId);
        
        [OperationContract]
        [FaultContract(typeof(SeatsAlreadyReservedFault))]
        int CreateBooking(int Status, int PhoneNumber, int DiscountType, int ShowId, List<int> Seats, int MemberId);

        [OperationContract]
        int MarkBookingAsSold(int id);
        #endregion

        #region . Login .
        [OperationContract]
        Login GetLoginByPhone(int phone);

        #endregion

        #region . Member .

        [OperationContract]
        Member FindMemberById(int memberId);

        [OperationContract]
        Member FindMemberByPhone(int phone);

        [OperationContract]
        int InsertMemberIntoDatabase(string name, int phone, string email, string Address, int zipcode, bool newsletter);

        #endregion
    }
}
